
package com.fis.mca.persistence;

import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;

import com.fis.mca.util.StringUtil;


/**
 * <p>Java class for mcaLanguage complex type.
 * 
 * <p>The following schema fragment specifies the expected content contained within this class.
 * 
 * <pre>
 * &lt;complexType name="mcaLanguage">
 *   &lt;complexContent>
 *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *       &lt;sequence>
 *         &lt;element name="code" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
 *         &lt;element name="isDefault" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
 *         &lt;element name="languageId" type="{http://www.w3.org/2001/XMLSchema}int"/>
 *         &lt;element name="mcaMailLogs" type="{http://www.w3.org/2001/XMLSchema}anyType" maxOccurs="unbounded" minOccurs="0"/>
 *         &lt;element name="mcaMessageContents" type="{http://www.w3.org/2001/XMLSchema}anyType" maxOccurs="unbounded" minOccurs="0"/>
 *         &lt;element name="mcaSmsLogs" type="{http://www.w3.org/2001/XMLSchema}anyType" maxOccurs="unbounded" minOccurs="0"/>
 *         &lt;element name="mcaSubLanguages" type="{http://www.w3.org/2001/XMLSchema}anyType" maxOccurs="unbounded" minOccurs="0"/>
 *         &lt;element name="mcaSubscribers" type="{http://www.w3.org/2001/XMLSchema}anyType" maxOccurs="unbounded" minOccurs="0"/>
 *         &lt;element name="name" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
 *         &lt;element name="status" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
 *       &lt;/sequence>
 *     &lt;/restriction>
 *   &lt;/complexContent>
 * &lt;/complexType>
 * </pre>
 * 
 * 
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "mcaLanguage", propOrder = {
    "code",
    "isDefault",
    "languageId",
    "mcaMailLogs",
    "mcaMessageContents",
    "mcaSmsLogs",
    "mcaSubLanguages",
    "mcaSubscribers",
    "name",
    "status"
})
public class McaLanguage implements Comparable<McaLanguage> {

    protected String code;
    protected String isDefault;
    protected int languageId;
    @XmlElement(nillable = true)
    protected List<Object> mcaMailLogs;
    @XmlElement(nillable = true)
    protected List<Object> mcaMessageContents;
    @XmlElement(nillable = true)
    protected List<Object> mcaSmsLogs;
    @XmlElement(nillable = true)
    protected List<Object> mcaSubLanguages;
    @XmlElement(nillable = true)
    protected List<Object> mcaSubscribers;
    protected String name;
    protected String status;

    /**
     * Gets the value of the code property.
     * 
     * @return
     *     possible object is
     *     {@link String }
     *     
     */
    public String getCode() {
        return code;
    }

    /**
     * Sets the value of the code property.
     * 
     * @param value
     *     allowed object is
     *     {@link String }
     *     
     */
    public void setCode(String value) {
    	this.code = value.toUpperCase().trim();
    }

    /**
     * Gets the value of the isDefault property.
     * 
     * @return
     *     possible object is
     *     {@link String }
     *     
     */
    public String getIsDefault() {
        return isDefault;
    }

    /**
     * Sets the value of the isDefault property.
     * 
     * @param value
     *     allowed object is
     *     {@link String }
     *     
     */
    public void setIsDefault(String value) 
    {
    	if ("1".equals(value) || "true".equalsIgnoreCase(value))
		{
    		this.isDefault = "1";
		}
    	else
    	{
    		this.isDefault = "0";
    	}
    }

    /**
     * Gets the value of the languageId property.
     * 
     */
    public int getLanguageId() {
        return languageId;
    }

    /**
     * Sets the value of the languageId property.
     * 
     */
    public void setLanguageId(int value) {
        this.languageId = value;
    }

    /**
     * Gets the value of the mcaMailLogs property.
     * 
     * <p>
     * This accessor method returns a reference to the live list,
     * not a snapshot. Therefore any modification you make to the
     * returned list will be present inside the JAXB object.
     * This is why there is not a <CODE>set</CODE> method for the mcaMailLogs property.
     * 
     * <p>
     * For example, to add a new item, do as follows:
     * <pre>
     *    getMcaMailLogs().add(newItem);
     * </pre>
     * 
     * 
     * <p>
     * Objects of the following type(s) are allowed in the list
     * {@link Object }
     * 
     * 
     */
    public List<Object> getMcaMailLogs() {
        if (mcaMailLogs == null) {
            mcaMailLogs = new ArrayList<Object>();
        }
        return this.mcaMailLogs;
    }

    /**
     * Gets the value of the mcaMessageContents property.
     * 
     * <p>
     * This accessor method returns a reference to the live list,
     * not a snapshot. Therefore any modification you make to the
     * returned list will be present inside the JAXB object.
     * This is why there is not a <CODE>set</CODE> method for the mcaMessageContents property.
     * 
     * <p>
     * For example, to add a new item, do as follows:
     * <pre>
     *    getMcaMessageContents().add(newItem);
     * </pre>
     * 
     * 
     * <p>
     * Objects of the following type(s) are allowed in the list
     * {@link Object }
     * 
     * 
     */
    public List<Object> getMcaMessageContents() {
        if (mcaMessageContents == null) {
            mcaMessageContents = new ArrayList<Object>();
        }
        return this.mcaMessageContents;
    }

    /**
     * Gets the value of the mcaSmsLogs property.
     * 
     * <p>
     * This accessor method returns a reference to the live list,
     * not a snapshot. Therefore any modification you make to the
     * returned list will be present inside the JAXB object.
     * This is why there is not a <CODE>set</CODE> method for the mcaSmsLogs property.
     * 
     * <p>
     * For example, to add a new item, do as follows:
     * <pre>
     *    getMcaSmsLogs().add(newItem);
     * </pre>
     * 
     * 
     * <p>
     * Objects of the following type(s) are allowed in the list
     * {@link Object }
     * 
     * 
     */
    public List<Object> getMcaSmsLogs() {
        if (mcaSmsLogs == null) {
            mcaSmsLogs = new ArrayList<Object>();
        }
        return this.mcaSmsLogs;
    }

    /**
     * Gets the value of the mcaSubLanguages property.
     * 
     * <p>
     * This accessor method returns a reference to the live list,
     * not a snapshot. Therefore any modification you make to the
     * returned list will be present inside the JAXB object.
     * This is why there is not a <CODE>set</CODE> method for the mcaSubLanguages property.
     * 
     * <p>
     * For example, to add a new item, do as follows:
     * <pre>
     *    getMcaSubLanguages().add(newItem);
     * </pre>
     * 
     * 
     * <p>
     * Objects of the following type(s) are allowed in the list
     * {@link Object }
     * 
     * 
     */
    public List<Object> getMcaSubLanguages() {
        if (mcaSubLanguages == null) {
            mcaSubLanguages = new ArrayList<Object>();
        }
        return this.mcaSubLanguages;
    }

    /**
     * Gets the value of the mcaSubscribers property.
     * 
     * <p>
     * This accessor method returns a reference to the live list,
     * not a snapshot. Therefore any modification you make to the
     * returned list will be present inside the JAXB object.
     * This is why there is not a <CODE>set</CODE> method for the mcaSubscribers property.
     * 
     * <p>
     * For example, to add a new item, do as follows:
     * <pre>
     *    getMcaSubscribers().add(newItem);
     * </pre>
     * 
     * 
     * <p>
     * Objects of the following type(s) are allowed in the list
     * {@link Object }
     * 
     * 
     */
    public List<Object> getMcaSubscribers() {
        if (mcaSubscribers == null) {
            mcaSubscribers = new ArrayList<Object>();
        }
        return this.mcaSubscribers;
    }

    /**
     * Gets the value of the name property.
     * 
     * @return
     *     possible object is
     *     {@link String }
     *     
     */
    public String getName() {
        return name;
    }

    /**
     * Sets the value of the name property.
     * 
     * @param value
     *     allowed object is
     *     {@link String }
     *     
     */
    public void setName(String value) {
        this.name = value.trim();
    }

    /**
     * Gets the value of the status property.
     * 
     * @return
     *     possible object is
     *     {@link String }
     *     
     */
    public String getStatus() {
        return status;
    }

    /**
     * Sets the value of the status property.
     * 
     * @param value
     *     allowed object is
     *     {@link String }
     *     
     */
    public void setStatus(String value) {
        this.status = value;
    }
    @Override
    public String toString()
    {
    	return this.name;
    }

	@Override
	public int compareTo(McaLanguage o)
	{
		String o1 = this.getName();
		String o2 = o.getName();
		return StringUtil.compareVietnameseString(o1, o2);
	}
}
